<?php

namespace app\model;

use ReflectionClass;
use think\facade\Db;
use think\facade\Log;



class ModifyQuery
{

    var $tableName;

    /**
     * @param $tableName
     */
    public function __construct($clazz)
    {
        $_tableName = findTableNameRef($clazz);
        Log::info("初始化 修改  tablename:{tablename}",[
            "tablename"=>$_tableName,
        ]);
        $this->tableName = $_tableName;
    }

    public function getQuery()
    {
        return Db::table($this->tableName);
    }

    public static function build($tableName,$isTaleName=false)
    {
        $query = new BaseQuery($tableName,$isTaleName);
        return $query->getQuery();
    }


    public  static function  raw(string $sql,$params){
      return   Db::query($sql, $params);
    }



}